package com.ruoyi.business.mapper;

import com.ruoyi.business.domain.Business;
import com.ruoyi.business.domain.BusinessMoney;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 基础业务Mapper接口
 *
 * @author xx
 * @date 2020-03-16
 */
public interface BusinessMapper {
    /**
     * 查询基础业务
     *
     * @param id 基础业务ID
     * @return 基础业务
     */
    Business selectBusinessById(Long id);

    /**
     * 查询基础业务列表
     *
     * @param business 基础业务
     * @return 基础业务集合
     */
    List<Business> selectBusinessList(Business business);

    /**
     * 新增基础业务
     *
     * @param business 基础业务
     * @return 结果
     */
    int insertBusiness(Business business);

    /**
     * 修改基础业务
     *
     * @param business 基础业务
     * @return 结果
     */
    int updateBusiness(Business business);

    /**
     * 删除基础业务
     *
     * @param id 基础业务ID
     * @return 结果
     */
    int deleteBusinessById(Long id);

    /**
     * 批量删除基础业务
     *
     * @param business 需要删除的数据ID
     * @return 结果
     */
    int deleteBusinessByIds(Business business);

    /**
     * 修改状态
     *
     * @param business 主键id
     * @return 结果
     */
    int changeStatus(Business business);

    int checkBusinessCodeUnique(@Param("businessCode") String businessCode);

    Business selectBusinessByUserId(@Param("businessType") Integer businessType, @Param("rechargeChannel") Integer rechargeChannel, @Param("userId") Long userId);

    void insertBusinessMoneys(List<BusinessMoney> prices);

    void deleteBusinessMoneys(@Param("businessId") Long businessId);

    List<Integer> selectBusinessTypesByUserId(@Param("userId") Long userId);

    List<Integer> selectRechargeChannelsByUserId(@Param("userId") Long userId);
}
